package org.seckill.dao;

import org.apache.ibatis.annotations.Param;
import org.seckill.entity.Seckill;
import org.seckill.page.PageQueryBean;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface SeckillMapper {
    int deleteByPrimaryKey(Long seckillId);

    int insert(Seckill record);

    int insertSelective(Seckill record);

    Seckill selectByPrimaryKey(Long seckillId);

    int updateByPrimaryKeySelective(Seckill record);

    int updateByPrimaryKey(Seckill record);

    List<Seckill> selectAll(@Param("offset") int offset,@Param("total") int total);

    List<Seckill> selectByPage(PageQueryBean pageQueryBean);

    int selectTotalRows();

    int reduceNumber(@Param("seckillId") Long seckillId,@Param("nowTime") Date nowTime);

}